package com.yuke.cloud.service.api.omc.service;

import com.yuke.cloud.common.security.feign.OAuth2FeignAutoConfiguration;
import com.yuke.cloud.common.util.wrapper.Wrapper;
import com.yuke.cloud.service.api.omc.dto.*;
import com.yuke.cloud.service.api.omc.service.hystrix.OmcOrderFeignApiHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;
import java.util.Map;


@FeignClient(value = "yuke-cloud-service-omc", configuration = OAuth2FeignAutoConfiguration.class,
        fallback = OmcOrderFeignApiHystrix.class, path = "${yuke.feign-path-omc}")
//@FeignClient(value = "yuke-cloud-service-omc", fallback = OmcOrderFeignApiHystrix.class)
public interface OmcOrderFeignApi {

    //商铺查看自己店铺某个时间段的销售额
    @GetMapping(value = "/api/omc/order/countSales")
    Wrapper CountSales(@RequestParam(value = "json") String json);

    //商品查看自己店铺某个时间段，某件商品的销售额
    @GetMapping(value = "/api/omc/order/countProductSalesByTime")
    Wrapper CountProductSalesbytime(@RequestParam(value = "json") String json);

    @GetMapping(value = "/api/omc/order/getit")
    Object getit(@RequestParam(value = "json") String json);

    @PostMapping("/api/omc/order/count")
    List<Map> countnum(@RequestBody List<Long> list);

    @PostMapping("/api/omc/order/getnum")
    Wrapper getnum(@RequestBody OdsOrderDto id);

    @PostMapping("/api/omc/order/gethistorynum")
    List<Map> gethistorynum(@RequestBody Map<String, List<Long>> niubi);

    @GetMapping("/api/getorderinforbyorderid")
    Object getorderinforbyorderid(@RequestParam(value = "orderid") Long orderid);

    @PostMapping("/api/saveorderdeliver")
    Long saveorderDeliver(@RequestBody Map map);

    @PostMapping("/api/countmonthnumbyprimikey")
    List<GoodsInfo> countmonthnumbyprimikey(@RequestBody List<GoodsInfo> shop_goods_id);

    @GetMapping("/api/getbyid")
    OdsOrderDto getbyid(@RequestParam(value = "orderid") Long orderid);

    @PostMapping("/api/omc/refund")
    int redund(@RequestBody Map map);

    @PostMapping("/api/getbyidS")
    List<OdsOrderDto> getbyidS(@RequestBody List<Long> orderids);

    @GetMapping("/api/changetorefund")
    int changetorefund(@RequestParam(value = "orderId") Long orderId, @RequestParam(value = "money") Double money);

    @GetMapping("/api/getmapbyorderid")
    Map getmapbyorderid(@RequestParam("orderId") Long aLong);

    @PostMapping("/api/updateOrderGoods")
    Integer updateOrderGoods(@RequestBody OdsOrderGoodsDto odsOrderGoodsDto);

    @PostMapping("/api/updateOrderPay")
    Integer updateOrderPay(@RequestBody OdsOrderDto odsOrderDto);

    @GetMapping("/api/getOrderAndGoodsByOrderId")
    OdsOrderDto getOrderAndGoodsByOrderId(@RequestParam(value = "orderId") Long orderId);

    @PostMapping("/api/countByShopIds")
    List<OdsOrderApiDto> countByShopIds(@RequestBody List<Long> shopIdList,@RequestParam(value = "beginTime")String beginTime,@RequestParam(value = "endTime")String endTime);

    @PostMapping("/api/countOrderByShopIds")
    Map countOrderByShopIds(@RequestBody List<Long> shopIds,@RequestParam(value = "beginTime") Date beginTime,@RequestParam(value = "endTime") Date endTime);

    @PostMapping("/api/countByDmsStore")
    List<DmsStoreOrderApi> countByDmsStore(@RequestBody List<DmsStoreOrderApi> dmsStoreOrderApis);

    @PostMapping("/api/selectTeamInfoBySpecIds")
    List<OdsTeamSpecInfoDto> selectTeamInfoBySpecIds(@RequestBody List<Long> specIds, @RequestParam(value = "warehouseId") Long warehouseId);

    @PostMapping("/api/sendAwardRecord")
    void sendAwardRecord(@RequestParam(value = "orderId") Long orderId);

    @PostMapping("/api/countByShopListByStoreOrderDtos")
    List<StoreOrderDto> countByShopListByStoreOrderDtos(@RequestBody List<StoreOrderDto> storeOrderDtos);

    @PostMapping("/api/countMoneyAndUpdate")
    Wrapper<OdsOrderDto> countMoneyAndUpdate(@RequestBody OdsOrderDto odsOrder);

    @PostMapping("/api/goodsSales")
    List<OdsGoodSalesApiDto> goodsSales(@RequestBody OdsGoodSalesApiDto odsGoodSalesApiDto);

    @GetMapping("/api/countTeamIntentNumber")
    Integer countTeamIntentNumber(@RequestParam(value = "userId") Long userId);

    @PostMapping("/api/selectTeamIntentByCondition")
    Wrapper<List<OdsTeamSpecIntentDto>> selectTeamIntentByCondition(@RequestBody OdsTeamSpecIntentDto odsTeamSpecIntentDto);

    @PostMapping("/api/updateIntentGoods")
    Integer updateIntentGoods(@RequestBody OdsTeamSpecGoods odsTeamSpecGoods);

}
